home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1995 October
/
EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso
/
Aminet
/
util
/
dtype
/
cdt_39_10.lha
/
cdt
/
source
/
RCS
/
classbase.h,v
< prev
next >
Wrap
Text File
|
1995-06-04
|
6KB
|
278 lines
head 39.4;
access;
symbols
V39_10:39.4
c3910:39.4
V39_9:39.3;
locks; strict;
comment @ * @;
39.4
date 95.06.04.16.48.00; author StRuppert; state Exp;
branches;
next 39.3;
39.3
date 95.05.10.14.57.49; author StRuppert; state Exp;
branches;
next ;
desc
@initial
@
39.4
log
@added tabs buffer
@
text
@/*
** $PROJECT: c.datatype
**
** $VER: classbase.h 39.4 (04.06.95)
**
** by
**
** Stefan Ruppert , Windthorststraße 5 , 65439 Flörsheim , GERMANY
**
** (C) Copyright 1995
** All Rights Reserved !
**
** $HISTORY:
**
** 04.06.95 : 039.004 : added tabs buffer
** 14.04.95 : 039.003 : added inline args support
** 11.03.95 : 039.002 : pen allocation stuff added
** 06.03.95 : 039.001 : initial
*/
/* ------------------------------- includes ------------------------------- */
#include <dos/dos.h>
#include <dos/dosextens.h>
#include <exec/types.h>
#include <exec/ports.h>
#include <exec/memory.h>
#include <exec/lists.h>
#include <exec/semaphores.h>
#include <exec/execbase.h>
#include <intuition/classes.h>
#include <intuition/classusr.h>
#include <intuition/cghooks.h>
#include <intuition/gadgetclass.h>
#include <graphics/gfxbase.h>
#include <graphics/gfx.h>
#include <graphics/text.h>
#include <libraries/iffparse.h>
#include <datatypes/datatypes.h>
#include <datatypes/datatypesclass.h>
#include <datatypes/textclass.h>
#include <clib/alib_protos.h>
#include <clib/alib_stdio_protos.h>
#include <string.h>
#include <dos.h>
#include <clib/macros.h>
#include <clib/dos_protos.h>
#include <clib/exec_protos.h>
#include <clib/intuition_protos.h>
#include <clib/iffparse_protos.h>
#include <clib/graphics_protos.h>
#include <clib/utility_protos.h>
#include <clib/datatypes_protos.h>
#include <clib/dtclass_protos.h>
#include <pragmas/dos_pragmas.h>
#include <pragmas/exec_pragmas.h>
#include <pragmas/intuition_pragmas.h>
#include <pragmas/iffparse_pragmas.h>
#include <pragmas/graphics_pragmas.h>
#include <pragmas/utility_pragmas.h>
#include <pragmas/datatypes_pragmas.h>
#include <pragmas/dtclass_pragmas.h>
#include <ctype.h>
/* --------------------------- include my stuff --------------------------- */
#include <register.h>
#include <debug.h>
#define ClassCall LibCall
#include "protos.h"
/* -------------- set some stuff for the generic classbase.c -------------- */
/* set , which datatype library should be opened during our OpenLibrary() */
#define SUPERCLASSDATATYPE "datatypes/text.datatype"
/* set the function name to get a pointer to our class */
#define ENGINE ObtainCEngine
#define DATATYPENAME "c.datatype"
/* ------------------------- ClassBase structure -------------------------- */
struct ClassBase
{
struct Library cb_Lib;
UWORD cb_UsageCnt;
struct Library *cb_SysBase;
struct Library *cb_DOSBase;
struct Library *cb_IntuitionBase;
struct Library *cb_GfxBase;
struct Library *cb_UtilityBase;
struct Library *cb_IFFParseBase;
struct Library *cb_DataTypesBase;
struct Library *cb_SuperClassBase;
BPTR cb_SegList;
struct SignalSemaphore cb_Lock; /* Access lock */
Class *cb_Class;
};
/* ---------------------------- library bases ----------------------------- */
#define SysBase cb->cb_SysBase
#define DOSBase cb->cb_DOSBase
#define UtilityBase cb->cb_UtilityBase
#define IntuitionBase cb->cb_IntuitionBase
#define IFFParseBase cb->cb_IFFParseBase
#define GfxBase cb->cb_GfxBase
#define DataTypesBase cb->cb_DataTypesBase
#define SuperClassBase cb->cb_SuperClassBase
/* ----------------------- datatype specific stuff ------------------------ */
enum
{
/* modes with style */
C_STANDARD,
C_COMMENT,
C_CPP,
C_KEYWORD,
C_STORAGE,
C_TYPES,
C_TYPENAME,
C_STRING,
C_NUMBER,
C_MAX,
/* modes without style */
C_CPPTEXTLIST,
};
struct Style
{
UWORD FgPen;
UWORD BgPen;
UWORD Style;
};
struct cdtMem
{
struct cdtMem *Next;
ULONG Size;
};
struct PenNode
{
struct MinNode pn_Node;
ULONG pn_Red;
ULONG pn_Green;
ULONG pn_Blue;
ULONG pn_Section;
LONG pn_Pen;
};
#define INLINE_BUFFER 50
struct InlineArgs
{
ULONG Lines;
UBYTE Keyword[INLINE_BUFFER];
UBYTE Pattern[INLINE_BUFFER];
};
/* ---------------------------- instance data ----------------------------- */
struct CData
{
APTR cd_Pool;
UWORD cd_TabLength;
struct
{
ULONG Nested : 1;
ULONG Inline : 1;
} cd_Flags;
struct InlineArgs cd_Inline;
struct List cd_PenList;
struct ColorMap *cd_ColorMap;
struct Style cd_CStyle[C_MAX];
struct List cd_UserTypes;
UBYTE cd_TabBuffer[100];
};
/* --------------------------- parser structure --------------------------- */
struct CParse
{
STRPTR BegPtr; /* pointer to the begin of the hole text */
STRPTR SegPtr; /* pointer to the text for the next segment */
STRPTR TxtPtr; /* pointer to the text for the next text segment */
STRPTR ActPtr; /* Actual text pointer */
STRPTR EndPtr; /* End text pointer */
UWORD TabWidth;
LONG Chars;
UWORD Mode;
UWORD LastMode; /* last segment index */
int Token; /* last token */
ULONG XOffset;
ULONG YOffset;
ULONG XOffsetAdd; /* for tab handling */
ULONG MaxWidth;
struct List *LineList; /* list to append line segments */
struct RastPort *RPort; /* tempory RastPort for TextLength() */
struct cdtMem *Memory; /* memory handling for bison parser */
struct CData *Data; /* link to the instance data */
};
int cdtparse_parse(struct ClassBase *cb,struct CParse *cparse);
int cdtparse_error(char *errstr);
void *cdtparse_alloc(struct ClassBase *cb,struct CParse *cparse,int size);
/* redirect bison alloca() to my own memory handling function */
#define alloca(x) cdtparse_alloc(cb,cparse,x)
@
39.3
log
@*** empty log message ***
@
text
@d4 1
a4 1
** $VER: classbase.h 39.3 (14.04.95)
d15 1
d191 2
@